﻿namespace CheccCoverplateCulvertAssemble.Entity
{
    /// <summary>
    /// 每个模块数据实体
    /// </summary>
    public class BlockEntity
    {
        private string _name;
        private List<Type> types;

        /// <summary>
        /// 模块名字
        /// </summary>
        public string Name { get => _name; set => _name = value; }

        /// <summary>
        /// 一个模块所对应的
        /// </summary>
        public List<Type> Types { get => types; set => types = value; }

        public BlockEntity()
        {
        }

        public BlockEntity(string name, List<Type> types)
        {
            Name = name;
            Types = types;
        }
    }

    /// <summary>
    /// 一种类型对象
    /// </summary>
    public class Type
    {
        private string _name;
        private List<SingleMaterial> _singleMaterials;

        /// <summary>
        /// 类型名称
        /// </summary>
        public string Name { get => _name; set => _name = value; }

        /// <summary>
        /// 一种类型对应的多种材质
        /// </summary>
        public List<SingleMaterial> SingleMaterials { get => _singleMaterials; set => _singleMaterials = value; }

        public Type()
        {
        }

        public Type(string name, List<SingleMaterial> singleMaterials)
        {
            Name = name;
            SingleMaterials = singleMaterials;
        }
    }

    /// <summary>
    /// 单列材质所对象
    /// </summary>
    public class SingleMaterial
    {
        private string _materialName;
        private string _unit;
        private double _value;
        private int _columnIndex;

        /// <summary>
        /// 材料名称
        /// </summary>
        public string MaterialName { get => _materialName; set => _materialName = value; }

        /// <summary>
        /// 材料单位
        /// </summary>
        public string Unit { get => _unit; set => _unit = value; }

        /// <summary>
        /// 列索引
        /// </summary>
        public int ColumnIndex { get => _columnIndex; set => _columnIndex = value; }

        /// <summary>
        /// 数值
        /// </summary>
        public double Value { get => _value; set => _value = value; }

        public SingleMaterial()
        {
        }

        public SingleMaterial(string materialName, string unit, int columnIndex, int value)
        {
            MaterialName = materialName;
            Unit = unit;
            ColumnIndex = columnIndex;
            Value = value;
        }

    }
}
